project(FreeEarth)

include_directories(${CMAKE_SOURCE_DIR}/interface)
include_directories(${CMAKE_SOURCE_DIR}/interface/x3manager)
include_directories(${CMAKE_SOURCE_DIR}/interface/FreeEarth)
include_directories(${CMAKE_SOURCE_DIR}/src)

SET(PROJECT_INTERFACE ${CMAKE_SOURCE_DIR}/interface/FreeEarth)
SET(PROJECT_SRC ${CMAKE_SOURCE_DIR}/src/FreeEarth)

set(INTERFACE_H_CPP
	${PROJECT_INTERFACE}/IFreeEarth.h
	${PROJECT_INTERFACE}/IRenderContext.h
)

SOURCE_GROUP(Interface FILES ${INTERFACE_H_CPP})

set(SRC_H_CPP
	${PROJECT_SRC}/FreeEarth.h
	${PROJECT_SRC}/FreeEarth.cpp
	${PROJECT_SRC}/RenderContext.h
	${PROJECT_SRC}/RenderContext.cpp
	${PROJECT_SRC}/Module.cpp
)

SOURCE_GROUP(Source FILES ${SRC_H_CPP})

add_library(
	${PROJECT_NAME} SHARED 
	${INTERFACE_H_CPP}
	${SRC_H_CPP}
	)	
											
target_link_libraries(
    ${PROJECT_NAME} 
    ${OPENSCENEGRAPH_LIBRARIES} 
   	debug ${osgEarth_DEBUG_LIBRARIES} optimized ${osgEarth_RELEASE_LIBRARIES} 
	debug ${osgEarthUtil_DEBUG_LIBRARIES} optimized ${osgEarthUtil_RELEASE_LIBRARIES}  
    )
	
ADD_DEFINITIONS(-D_USRDLL)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SUFFIX  ".pln")

INSTALL(TARGETS ${PROJECT_NAME}  DESTINATION lib)
INSTALL(TARGETS ${PROJECT_NAME}  DESTINATION bin)
